<template>
    <div>
      <!--    搜索表单-->
      <div>
        <el-divider></el-divider>
        <div style="float: left;top:0px">
          <i style="font-size: x-large" class="el-icon-document-checked"></i><span
            style="font-weight:bold;font-size:x-large">检查项目查看</span>
        </div>
        <br>
        <el-divider></el-divider>
        <div>
          <el-input v-model="input1" style="width: 270px;float: left;" placeholder="请输入患者病历号"></el-input>
          <el-input v-model="input2" style="width: 270px; margin-left: 20px;float: left;"
                    placeholder="请输入患者姓名"></el-input>
          <el-button style="margin-left: 25px;float: left" type="primary"> 搜索</el-button>
          <br>
        </div>
        <br> <br>
      </div>
      <el-divider></el-divider>
      <el-table
          :data="tableData.filter(data => !search || data.name.toLowerCase().includes(search.toLowerCase()))"
          style="width: 100%">
        <el-table-collumn
            label="编号"
            prop="id">
        </el-table-collumn>
        <el-table-column
            label="患者姓名"
            prop="realName">
        </el-table-column>
        <el-table-column
            label="患者病历号"
            prop="caseNumber">
        </el-table-column>
        <el-table-column
            label="患者年龄"
            prop="age">
        </el-table-column>
        <el-table-column
            label="患者性别"
            prop="gender">
        </el-table-column>
        <el-table-column
            align="right">
          <template slot="header" slot-scope="scope">
          </template>
          <template slot-scope="scope">
            <el-button type="primary" @click="open">检查项目</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
          layout="prev, pager, next"
          :total="50">
      </el-pagination>
    </div>
  </template>
  
  
  <script>
  import axios from "axios";
  
  export default {
    data() {
      // return {
      //   input1:'',
      //   input2:'',
      //   form: {},
      //   tableData: [{
      //     id: '1',
      //     name: '梦琪',
      //     number: '100013',
      //     age:'23',
      //     sex:'女'
      //   }, {
      //     id: '2',
      //     name: '忆柳',
      //     number: '100014',
      //     age:'22',
      //     sex:'男'
      //   }, {
      //     id: '3',
      //     name: '赵三',
      //     number: '100012',
      //     age:'23',
      //     sex:'女'
      //   }, {
      //     id: '4',
      //     name: '李六',
      //     number: '100011',
      //     age:'22',
      //     sex:'男'
      //   }],
      //   search: ''
      return {
        tableData: [],
      }
    },
    methods: {
      queryL() {
        axios.get("http://127.0.0.1:8088/check/query").then(
            (s) => {
              this.tableData = s.data.data;
            }
        );
  
  
      },
  
  
      open() {
        this.$alert('此患者的检查项目:XXXXXX', {
          confirmButtonText: '确定',
          callback: action => {
            this.$message({
              type: 'info',
              message: `action: ${action}`
            });
          }
        });
      },
      handleChangePass(row) {
        this.form = JSON.parse(JSON.stringify(row))
        this.dialogFormVisible = true
      },
      handleEdit(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      }
    },
    mounted() {
      this.queryL();
    }
  };
  </script>